package com.ght.springboot.vo;

import io.searchbox.core.Doc;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @description: 封装Elasticsearch Doc
 * @author: haitao.gao
 * @create: 2019-02-11 14:56
 **/
public class ZDocVo extends Doc {

    /**
     *
     * @param index 索引
     * @param id  ID
     * @param filedList 字段名
     */
    public ZDocVo(String index, String id, List<String> filedList) {
        super(index, id);
        if(!CollectionUtils.isEmpty(filedList)){
            super.setSource(filedList);
        }
    }

    /**
     *
     * @param index 索引
     * @param type  类型
     * @param id    ID
     * @param filedList 字段名
     */
    public ZDocVo(String index, String type, String id, List<String> filedList) {
        super(index, type, id);
        if(!CollectionUtils.isEmpty(filedList)){
            super.setSource(filedList);
        }
    }


}
